package com.arrogames.blondbattle.ui.buttons 
{
	import com.arrogames.blondbattle.assets.AssetManager;
	import com.arrogames.blondbattle.model.WorldDefinition;
	import feathers.controls.text.TextFieldTextRenderer;
	import feathers.core.ITextRenderer;
	import flash.text.TextFormat;
	import starling.display.Button;
	import starling.display.Image;
	import starling.events.Event;
	import starling.textures.Texture;
	
	/**
	 * ...
	 * @author Robin van den Bogaard
	 */
	public class WorldButton extends Button {
		static public const START:String = "WorldButton::start";
		
		private var world:WorldDefinition;
		
		public function WorldButton(text:String, world:WorldDefinition) {
			super(AssetManager.instance.getTexture("MenuButtonBg"));
			this.world = world;		
			this.text = text;
			
			this.addEventListener(Event.TRIGGERED, clickHandler);
			
			fontName = "comic";
			fontSize = 12;
			fontColor = 0x000000;
		}
		
		private function clickHandler(e:Event):void {
			dispatchEventWith(START, true, world);
		}
		
	}

}